<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>添加员工页面</h1>
<div>
  <input type="text" placeholder="员工姓名" v-model="emp.name">
  <input type="text" placeholder="工资" v-model="emp.sal">
  <input type="text" placeholder="工作" v-model="emp.job">
  <input type="button" value="添加" @click="insert()">
</div>
<!--引入Vue框架-->
<script src="https://unpkg.com/vue@2.6.14/dist/vue.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/a    xios/0.21.1/axios.min.js"></script>
<script>
  let v =new Vue({
        el:"body>div",
        data:{
          emp:{
            name:"",
            sal:0,
            job:""
          }
        },
        methods:{
          insert(){
            axios.post("/insert",v.emp).then(function (response ){
                  alert("添加成功");
                  location.href="/";
            })

          }
        }

  })
</script>
</body>
</html>